package cn.sylinx.hbatis.ext.common.repository;

import cn.sylinx.hbatis.ext.AbstractDaoSingleton;
import cn.sylinx.hbatis.ext.common.spi.HbatisServiceManager;

public class DaoSingleton extends AbstractDaoSingleton<CommonDaoService> {

	public static final DaoSingleton ME = new DaoSingleton();

	private DaoSingleton() {
	}

	@Override
	protected String getDefaultDatasourceName() {
		return HbatisServiceManager.getHbatisService().getDatasourceName();
	}

	@Override
	protected CommonDaoService createDaoService(String datasourceName) {
		return new CommonDaoServiceImpl(new CommonRepositoryImpl(datasourceName));
	}

}
